import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by liuteng on 2015/1/9.
 */
public class JavaHash {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int n = in.nextInt();
            int[] hash = new int[50000];
            int num = 0;
            Arrays.fill(hash,0);         // 这边不知道怎么写。。。
            for(int i=1;i<=n;i++){
                int a = in.nextInt();
                hash[a]++;
                if(hash[a] >= (n+1)/2){
                    num = a;
                }
            }
            System.out.println(num);
        }
    }
}
